package com.study.web.entity;

import java.util.Date;

import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.NotEmpty;

import com.study.common.base.entity.BaseEntity;

/**
 * @ZhName:系统角色实体类
 * @table:sys_role
 * @author:yaojinshan
 * @createTime:2017-06-11 10:47
 */
public class SysRole extends BaseEntity {

    /**
	 * 
	 */
	private static final long serialVersionUID = 5749435738960865844L;
	/**
     * 角色中文名
     */
	@Size(max = 15, min = 2,message = "角色中文名长度必须在2到15之间")
	@Pattern(regexp="^[\u4e00-\u9fa5]+$",message="角色中文名只能输入汉字")
	@NotEmpty(message="角色中文名不能为空")
    private String zhName;
    /**
     * 角色标识
     */
	@NotEmpty(message="角色标识不能为空")
	@Size(max = 15, min = 5,message = "角色标识长度必须在5到15之间")
	@Pattern(regexp="^[a-zA-Z0-9_-]+$",message="角色标识只能输入数字、字母、下划线、横线")
    private String enName;
    /**
     * 创建人id
     */
    private Long createrId;
    /**
     * 更新人id
     */
    private Long updaterId;
    /**
     * 更新时间
     */
    private Date updateTime;
    /**
     * 所属子系统
     */
    private String subSystem;
    /**
     * 组织机构id
     */
    private String orgId;
    /**
     * 角色状态  1 可用  2 失效
     */
    private Integer status;
    /**
     * 角色描述
     */
    private String remark;

    public String getZhName() {
        return zhName;
    }
    public void setZhName(String zhName) {
        this.zhName = zhName == null ? null : zhName.trim();
    }
    public String getEnName() {
        return enName;
    }
    public void setEnName(String enName) {
        this.enName = enName == null ? null : enName.trim();
    }
    public Long getCreaterId() {
        return createrId;
    }
    public void setCreaterId(Long createrId) {
        this.createrId = createrId;
    }
    public Long getUpdaterId() {
        return updaterId;
    }
    public void setUpdaterId(Long updaterId) {
        this.updaterId = updaterId;
    }
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    public String getSubSystem() {
        return subSystem;
    }
    public void setSubSystem(String subSystem) {
        this.subSystem = subSystem == null ? null : subSystem.trim();
    }
    public String getOrgId() {
        return orgId;
    }
    public void setOrgId(String orgId) {
        this.orgId = orgId == null ? null : orgId.trim();
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark == null ? null : remark.trim();
    }
    /**
     * @return String
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(getId());
        sb.append(", zhName=").append(zhName);
        sb.append(", enName=").append(enName);
        sb.append(", createrId=").append(createrId);
        sb.append(", createTime=").append(getCreateTime());
        sb.append(", updaterId=").append(updaterId);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", subSystem=").append(subSystem);
        sb.append(", orgId=").append(orgId);
        sb.append(", status=").append(status);
        sb.append(", remark=").append(remark);
        sb.append("]");
        return sb.toString();
    }
}